package com.lb.videoplay.activity;


import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.support.v4.content.res.ResourcesCompat;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.blankj.utilcode.util.ToastUtils;
import com.jude.swipbackhelper.SwipeBackHelper;
import com.lb.videoplay.R;
import com.lb.videoplay.statuslib.StatusUtil;
import com.lb.videoplay.utils.CommonUtils;

import java.sql.Time;

/**
 * Created by Mr.lb
 * 时间： 2018/11/15
 * 包名： com.lb.videoplay.activity
 * 描述： 品牌介绍
 */
public class IntroductionActivity extends FragmentActivity implements View.OnClickListener {

    private TextView mCenterTitle;
    private TextView mLeftTitleIcon;


    @Override
    protected void onDestroy() {
        super.onDestroy();
        SwipeBackHelper.onDestroy(this);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_introduction);
        SwipeBackHelper.onCreate(this);  //右侧滑动退出
        initWidget();
        initTitle();
        initEvent();
    }



    public void initWidget() {
        mLeftTitleIcon = findViewById(R.id.left_title_icon);
        mCenterTitle = findViewById(R.id.center_title);
    }


    public void initEvent() {
        mLeftTitleIcon.setOnClickListener(this);
    }

    //初始化标题
    public void initTitle() {
        // 第二个参数是是否沉浸,第三个参数是状态栏字体是否为黑色
        StatusUtil.setSystemStatus(this, true, true);
        mCenterTitle.setText(getText(R.string.app_me_brand));
        Drawable nav_up = ResourcesCompat.getDrawable(getResources(), R.drawable.back, null);
        nav_up.getMinimumHeight();
        nav_up.setBounds(0, 0, nav_up.getIntrinsicWidth(), nav_up.getIntrinsicWidth());
        mLeftTitleIcon.setCompoundDrawables(null, null, nav_up, null);
    }

    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        SwipeBackHelper.onPostCreate(this);
    }

    @Override
    public void onClick(View v) {
        int i = v.getId();
        if (i == R.id.left_title_icon) {
            finish();
        }
    }
}
